<?php
namespace Admin\Controller;
class ProductController extends BaseController{
	function add(){
		$type=D("Type");
		$optionStr=$type->getType();
		$this->assign('optionstr',$optionStr);
		$this->display();
	}
	function save(){
		//实例化upload()
		$uploadOb=new \Think\Upload();
		// 	设置 __set()
		$uploadOb->mimes=array('image/png',"image/gif","image/jpeg");
		$uploadOb->autoSub=false;
		$uploadOb->rootPath="./Public/Uploads/";
		//调用 Upload() 保存图片
		$imageOb=$uploadOb->Upload();
		$imageRe=$uploadOb->upload();
		if($imageRe){
			//水印 缩略图
			$_POST['imagename']=$imageRe[0]['savename'];
		}else{
			//var_dump($uploadOb->getError());
			//exit();
		}
		//调用M层
		//数据处理
		
	}
}